package xin.core.jpa.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import xin.core.jpa.JpaConstant;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import java.time.LocalDateTime;
import java.util.Date;

@MappedSuperclass
@Data
@ToString(callSuper=true)
@EqualsAndHashCode(callSuper = true)
public class AutoDateUUIDEntity extends UUIDEntity {

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @Column()
    protected Date createTime;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @Column()
    protected Date lastModifyTime;
    @Column(length = JpaConstant.UidColumnLength, updatable = false)
    protected String createBy;

    @Column(length = JpaConstant.UidColumnLength)
    protected String lastModifyBy;
}